

 function showPreview(source) { 
        var container=document.getElementById("container-my");
        var length=container.getElementsByTagName('img').length;
        if(length<=6&&(length+source.files.length)<=6)
        {
          
           
           for(i=0;i<source.files.length;i++)
           { 

             var file=source.files[i];
             if(window.FileReader) {  
                 var fr = new FileReader();  
                 fr.readAsDataURL(file);  
                 fr.onloadend = function(e) { 

                     x0=document.getElementById("container-spsp").cloneNode(true);
                     x0.getElementsByTagName("span")[0].style.display="block";
                     x=x0.getElementsByTagName("img")[0];
                     y=document.getElementById("container-my");
                     x.src = e.target.result; 
                     y.appendChild(x0); 

                     $(".container-img-delete .glyphicon-remove").on("click",function(){

                         $(this).parent().remove();
                      
                     })
                 };  
              } 


           }


           
        }
        else{
            alert("最多上传5张描述图片");
        }
        
    }  




    



